package edu.mercer.employmentcalculator;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
//import android.view.Window;
import android.content.Intent;

import android.widget.Button;
//import android.widget.Toast;
import android.view.Menu;

public class MainActivity extends Activity
{
	private Button equivButton;
	private Button compareButton;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		//requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_main);
		
		this.equivButton = (Button)findViewById(R.id.btnCalculateSalary);
		this.equivButton.setOnClickListener(myClickListener);
		this.compareButton = (Button)findViewById(R.id.btnCompareSalary);
		this.compareButton.setOnClickListener(myClickListener);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	View.OnClickListener myClickListener  =  new View.OnClickListener()
	{		
		public void onClick(View v)
		{
			Intent intent = new Intent("edu.mercer.CURRENTCOMPENSATION");
			
			if (v == equivButton)
			{
				intent.putExtra(Constants.Mode, Constants.EquivCode);
			}
			else if (v == compareButton)
			{
				intent.putExtra(Constants.Mode, Constants.CompareCode);
			}
			
			startActivity(intent);
			//startActivityForResult(calledActv, actv2Code);
		}
	};
	
	/*// use this to react to ActivityForResult finishing
	public void onActivityResult(int rcvdActvCode, int rcvdRsltCode, Intent rcvdData)
	{
		if (rcvdActvCode == Constants.CompareCode)
		{
			// do nothing for now		
		}
	}
	*/
}
